/*
 * @Author: Grant
 * @Date: 2020-12-26 20:28:59
 * @LastEditTime: 2020-12-27 15:19:06
 * @LastEditors: Grant
 * @FilePath: \nest-crud-basic\src\main.ts
 */
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.useGlobalPipes(new ValidationPipe());
  const options = new DocumentBuilder()
    .setTitle('Nest Basic CRUD example')
    .setDescription('Nest Basic CRUD description')
    .setVersion('0.0.1')
    .build();
  const document = SwaggerModule.createDocument(app, options);
  SwaggerModule.setup('docs', app, document);
  await app.listen(5800);
}
bootstrap();
